#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include "common.h"
#include "tempprocess.h"
#include "environment.h"

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    double k1 = 0.0;
    double k2 = 0.0;

    std::map<std::pair<int,int>,Point*>  *tmp = new std::map<std::pair<int,int>,Point*> ();
    std::map<QString,cv::Mat> *exportImgs = new std::map<QString,cv::Mat>();
    int selectedIndex = 0;
    EnvironmentInfo *envInfo;
    environment *env;
    QImage currImg;

    MainWindow(QWidget *parent = nullptr);
    void dragEnterEvent(QDragEnterEvent *event) override;
    void dropEvent(QDropEvent *event) override;
    ~MainWindow();
    void changeMode(int mode);
    int getMode();
    std::map<int,EnvironmentInfo*>* getEnvLists();
    EnvironmentInfo* getCurrEnvironment();
    EnvironmentInfo* selectEnvironment(int index);
    void saveCurrentEnvironment(EnvironmentInfo *t);
    void setTempProcess(TempProcess* p);
    TempProcess* getTempProcess();
    std::pair<int,QString> getStatus();
    void setStatus(int s);
private:
    //0-观察模式,1-修改模式
    int mode = 0;
    //0-平移,1-旋转
    int status = 0;
    TempProcess *tmpProc;
    Ui::MainWindow *ui;
    std::map<int,QString> statusMap = {
        {0,"平移"},
        {1,"旋转"}
    };

};
#endif // MAINWINDOW_H
